<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<%@ taglib prefix="his_fns" uri="/WEB-INF/tlds/his_fns.tld" %>
<script type="text/javascript">
    function page(n, s) {
        $("#pageNo").val(n);
        $("#pageSize").val(s);
        $("#searchForm").submit();
        return false;
    }
</script>
<div class="app">
    <section class="layout">
        <section class="main-content col-lg-12">
            <div class="content-wrap">
                <div class="wrapper" style="bottom: 50px;">
                    <ul class="nav nav-tabs">
                        <li class="active">
                            <a href="#" onclick="loadDiv('mainCenterDiv','${ctx}/blood/useBloodInfo/index')">患者用血查询</a>
                        </li>
                    </ul>
                    <section class="panel panel-default">
                        <div class="panel-body">
                            <div class="table-responsive no-border">
                                <div class="datatable-top">
                                    <div class="pull-left">
                                        <form:form id="searchForm" modelAttribute="useBloodInfoVo"
                                                   onsubmit="return loadDivForm('mainCenterDiv','searchForm','${ctx}/blood/useBloodInfo/index');"
                                                   method="post" class="form-inline">
                                            <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}" />
                                            <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}" />
                                            <div class="form-group">
                                                <label class=" control-label">姓名：</label>
                                                <form:select path="name" id="name" htmlEscape="false" class="form-control" maxlength="2" data-parsley-required="true">
                                                    <form:options items="${his_fns:getPatientInHospList()}" itemLabel="name" itemValue="name" htmlEscape="false" />
                                                </form:select>
                                            </div>
                                            <div class="form-group">
                                                <label class=" control-label">住院号：</label>
                                                <form:select path="visitNo" id="visitNo" htmlEscape="false" class="form-control" maxlength="64" data-parsley-required="true">
                                                    <form:options items="${his_fns:getPatientInHospList()}" itemLabel="visitNo" itemValue="visitNo" htmlEscape="false" />
                                                </form:select>
                                            </div>
                                            <div class="form-group">
                                                <button class="btn btn-primary" id="searchUseBloodInfo" type="submit">查询</button>
                                            </div>
                                        </form:form>
                                    </div>
                                </div>
                                <table id="contentTable" class="table table-bordered table-striped mg-t datatable">
                                    <thead>
                                    <tr>
                                        <th>住院号</th>
                                        <th>患者姓名</th>
                                        <th>性别</th>
                                        <th>年龄</th>
                                        <th>所在科室</th>
                                        <th>所在病区</th>
                                        <th>申请单号</th>
                                        <th>申请用血量</th>
                                        <th>血袋号</th>
                                        <th>储血量</th>
                                        <th>单位</th>
                                        <th>血型</th>
                                        <th>血液成分</th>
                                        <th>发血日期</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <c:forEach items="${page.list}" var="useBloodInfoVo">
                                        <tr>
                                            <td>${useBloodInfoVo.visitNo}</td>
                                            <td>${useBloodInfoVo.name}</td>
                                            <td>${fns:getDictLabel(useBloodInfoVo.sex, 'SEX_DICT', '')}</td>
                                            <td>${useBloodInfoVo.age}</td>
                                            <td>${fns:getDeptName(useBloodInfoVo.deptStayed,'')}</td>
                                            <td>${fns:getDeptName(useBloodInfoVo.wardCode,'')}</td>
                                            <td>${useBloodInfoVo.applyNum}</td>
                                            <td>${useBloodInfoVo.transCapacity}</td>
                                            <td>${useBloodInfoVo.bloodId}</td>
                                            <td>${useBloodInfoVo.bloodCapacity}</td>
                                            <td>${fns:getDictLabel(useBloodInfoVo.units, 'BLOOD_UNIT_DICT', '')}</td>
                                            <td>${fns:getDictLabel(useBloodInfoVo.patBloodGroup,'BLOOD_TYPE_DICT' ,'')}</td>
                                            <td>${his_fns:getBloodComponentName(useBloodInfoVo.componentName)}</td>
                                            <td>${useBloodInfoVo.bloodOutDate}</td>
                                        </tr>
                                    </c:forEach>
                                </table>
                                <div class="pagination">${page}</div>
                            </div>
                        </div>
                    </section>
                </div>
            </div>
        </section>
    </section>
</div>
